Skip to content

Conversation

@AsakerMohd
Copy link
Contributor

Description of changes:
Added a new lambda span processor that

  1. Overwrites the INTERNAL API Span (example: opentelemetry.instrumentation.flask) to SERVER
  2. adds a new flag to Lambda Spans if there are multiple server spans in the trace.

Also updated the Operation Name logic so that if the span is an opentelemetry.instrumentation.flask span, the operation name is the API Route instead of the FunctionHandler operation name. This makes it easier to identify that the Span is an API span in the Application Signals console.

Testing:
Added unit test to test processor. Also tested by creating a lambda layer. The lambda span does have the new flag and the operation name for the API Span is the API Route.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@AsakerMohd AsakerMohd requested a review from a team as a code owner March 4, 2025 23:04
@AsakerMohd AsakerMohd merged commit 08a9c1a into main Mar 10, 2025
12 checks passed
@AsakerMohd AsakerMohd deleted the lambdaMicroservice branch March 10, 2025 18:21
yiyuan-he pushed a commit to yiyuan-he/aws-otel-python-instrumentation that referenced this pull request Mar 11, 2025
*Description of changes:*
Added a new lambda span processor that 
1. Overwrites the INTERNAL API Span (example:
`opentelemetry.instrumentation.flask`) to SERVER
2. adds a new flag to Lambda Spans if there are multiple server spans in
the trace.

Also updated the Operation Name logic so that if the span is an
`opentelemetry.instrumentation.flask` span, the operation name is the
API Route instead of the FunctionHandler operation name. This makes it
easier to identify that the Span is an API span in the Application
Signals console.

*Testing:*
Added unit test to test processor. Also tested by creating a lambda
layer. The lambda span does have the new flag and the operation name for
the API Span is the API Route.

By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants